﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyDaiLyVersion2.QuanLyGiaoDien
{
    public partial class frmDiaChiCSDL : Form
    {
        public static string sDuongDan = "";
        public frmDiaChiCSDL()
        {
            InitializeComponent();
        }

        private void btnMo_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter = "File (*.mdb)|*.mdb";
            openFileDialog1.Multiselect = false;
            openFileDialog1.Title = "Chọn CSDL";
            openFileDialog1.FileName = "QuanLyDaiLy.mdb";
            DialogResult dgResult = openFileDialog1.ShowDialog();
            if (dgResult == DialogResult.OK)
            {
                txtFile.Text = openFileDialog1.FileName;
            }
        }

        private void btnChon_Click(object sender, EventArgs e)
        {
            if (txtFile.Text.Trim().Length == 0)
            {
                MessageBox.Show("Bạn chưa chọn đường dẫn và tên cơ sở dư liệu", "Thông báo lỗi");
                return;
            }

            sDuongDan = txtFile.Text.Trim();
            this.Hide();
            MainForm mainForm = new MainForm();
            mainForm.ShowDialog();
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
